package DAOImp;

import java.util.List;

import org.springframework.stereotype.Repository;

import DAO.AbsHbnDao;
import DAO.UserDAO;
import POJO.User;

@Repository
public class UserDaoImp extends AbsHbnDao<User> implements UserDAO{

	static final String FIND_USER_BY_USERNAME = "FROM User WHERE userName=?";
	
	public User findUserByUserName(String username) {
		List<User> s = getSession()
				.createQuery(FIND_USER_BY_USERNAME)
				.setParameter(0, username)
				.list();
		System.out.println("================" +s.size());
		if (s.size() > 0)
			
			return s.get(0);
		else
			return null;
	}

}
